﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Text;

namespace NMemcached.Client.Configuration
{
    internal class NMemcachedConfigurationSection : ConfigurationSection
    {
        private const string ConnectionProviderKey = "connectionProvider";
        private const string NamespaceKey = "xmlns";
        private const string UseUTCKey = "useUTC";

        //Attributes
        [ConfigurationProperty(NMemcachedConfigurationSection.NamespaceKey, IsRequired = false)]
        public string ConfigurationNamespace
        {
            get
            {
                return (string)this[NMemcachedConfigurationSection.NamespaceKey];
            }
        }

        [ConfigurationProperty(NMemcachedConfigurationSection.UseUTCKey, IsRequired = false, DefaultValue = false)]
        public bool UseUTC
        {
            get
            {
                return (bool)this[NMemcachedConfigurationSection.UseUTCKey];
            }
        }

        //Child elements
        [ConfigurationProperty(NMemcachedConfigurationSection.ConnectionProviderKey, IsRequired = true)]
        public ServerElementCollection Servers
        {
            get
            {
                return (ServerElementCollection)this[NMemcachedConfigurationSection.ConnectionProviderKey];
            }
        }

        public NMemcachedConfigurationSection()
            : base()
        {
        }
    }
}
